<template>
    <div>
        <div>friend application</div>
    <div v-for="item,key in props.applicationList">
         {{ item.friendName }}
         <button @click="handle(item.id,'1',item.friendName,key)">同意</button>
         <button @click="handle(item.id,'2',item.friendName,key)">拒绝</button>
    </div>
    </div>

</template>
<script setup lang="ts">
import ChatUserApplicationApi from '@/api/ChatUserApplication'
const props = defineProps<{
    applicationList:Array<any>
}>()
const emit = defineEmits<{
}>()
const handle = (id:string,status:string,firendName:string,index:number) => {
    ChatUserApplicationApi.respondToFriendApplication(id,status).then(res => {
        if(res.data.code == '200'){
            props.applicationList.splice(index,1)
        }
    })
}
</script>
<style scoped>

</style>